﻿<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
    <head>
        <title>邀请人员</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
        <link rel="stylesheet" href="${ctx}/css/base_layout.css" />
        <script src="../js/jquery.min.js"></script>
        <script type="text/javascript" src="../js/jquery.qrcode.min.js"></script>
        <script type="text/javascript" src="../js/hideWeiXinOptionMenu.js"></script>
        <script type="text/javascript">
            $(function(){
                $('#output').qrcode("http://gouda1.xinleju.cn:8080/gouda-jm/invite/inviteform.do?code=${code}");
            });
        </script>
    </head>
	 <body>
        <div class="invitation_main">
            <div class="content_top">
                <div class="top1">点击右上角</div>
                <div class="top2">把二维码发送给指定朋友或分享到朋友圈</div>
                <div class="top2">可快速邀请人员加入您的企业号</div>
            </div>
            <div class="two_dimension_code">
              <div class="circle"><img src="${ctx}/images/hema.png"></div>
			  <div class="code_words">鑫苑名家in新乐居</div>
				   <div class="code_body">
				   <div id="output">
				     <span><img src='${ctx}/images/hema.png'  style="width:40px;height:40px;"></span>
				   </div>
                </div>
              
            </div>
            <div class="invitation_footer"></div>
        </div>
    </body>
	        <script type="text/javascript" src="${ctx}/js/jquery-2.1.4.min.js" ></script>
			<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
        <script type="text/javascript">
           $(function(){
                var width=$(".two_dimension_code").css("width"); 
                    width=width.slice(0,-2); 
                var  height=parseInt(width)+20;
               $(".two_dimension_code").css("height",height);
               $(".two_dimension_code").css("min-height",340);

               
            var wxConfig= {

            appId:"${corpid}",
            timestamp:"${timestamp}",
            nonceStr:"${nonceStr}",
            signature:"${signature}"
            }

            var shareConfig = {
            shareTitle: 'asdasd',
            descContent: 'sdasd',
            link:"http://www.baidu.com",
            imgUrl:"${ctx}/images/hema.png"
            }
            wxFn(wxConfig, shareConfig);

           })
         
		 // var wx = data.data.config;

		 function wxFn(wxConfig, attr) {
            if (wxConfig) {
                wx.config({
                      debug: true, 
                    appId: wxConfig.appId,
                    timestamp: wxConfig.timestamp,
                    nonceStr: wxConfig.nonceStr,
                    signature: wxConfig.signature,
                    jsApiList: ["onMenuShareTimeline", "aonMenuShareAppMessage", "onMenuShareQQ", 'previewImage']
                });
                wx.ready(function() {
                    var imgUrl = attr.imgUrl;
                    var lineLink = attr.link;
                    var descContent = attr.descContent;
                    var shareTitle = attr.shareTitle;

                    wx.onMenuShareAppMessage({
                        title: shareTitle,
                        desc: descContent,
                        link: lineLink,
                        imgUrl: imgUrl,
                        type: 'link',
                        dataUrl: '',
                        success: function() {},
                        cancel: function() {}
                    });

                    // 分享到朋友圈
                    wx.onMenuShareTimeline({
                        title: shareTitle,
                        link: lineLink,
                        imgUrl: imgUrl,
                        desc: descContent,
                        success: function() {},
                        cancel: function() {}
                    });
                    wx.onMenuShareQQ({
                        title: shareTitle,
                        link: lineLink,
                        imgUrl: imgUrl,
                        desc: descContent,
                        success: function() {},
                        cancel: function() {}
                    });
                });
            };
        }

        </script>
</html>